<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>骨医快线</title>
	<link href="../../css/mui.plus.css" rel="stylesheet" />				
</head>
<body>
	<header class="mui-bar mui-bar-nav oe-pri-bar">
	    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	    <h1 id="title" class="mui-title">加载中...</h1>
	</header>
	
	<div class="mui-content">
	    <ul id="list-scale" class="mui-table-view">
            <li class="mui-table-view-cell">
                <a>
					加载中...
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a>
					加载中...
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a>
					加载中...
                </a>
            </li>
        </ul>
	</div>
	
	<script id="tmp-scale" type="text/html">
		{{each data as v i}}
			<li class="mui-table-view-cell" data-id = "{{v.rs_id}}">
                <a>
					{{v.rs_name}}
                </a>
            </li>
		{{/each}}
	</script>
	
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/app.js"></script>
	<script src="../../js/lib/template.js"></script>
	<script type="text/javascript">
		(function($, a){
			var wv,
				html,
				tmpData,
				transData,
				dataFromOpener,
				title = document.getElementById("title"),
				listScale = document.getElementById("list-scale");
			
			$.plusReady(function(){
				wv = plus.webview.currentWebview();
				transData = wv.transData;
				rec_id = wv.rec_id;
				dataFromOpener = wv.dataFromOpener;
				
				
				
				// 页面初始化
				title.innerHTML = transData.data[0].rs_category;
				tmpData = transData;
				html = template('tmp-scale', tmpData);
				listScale.innerHTML = html;
				
				// 监听li的点击事件
				$('#list-scale').on('tap', 'li', function(){
					var rs_id = this.dataset.id;
					if(rec_id){
						$.openWindow({
							url: 'detail-rec.html',
							waiting: {
								autoShow: false
							},
							extras: {
								rs_id: rs_id,
								rec_id: rec_id
							}
						});
					}else if(dataFromOpener && dataFromOpener.module === 'FO'){
						$.openWindow({
							url: 'detail-fo.html',
							waiting: {
								autoShow: false
							},
							extras: {
								rs_id: rs_id,
								dataFromOpener: dataFromOpener
							}
						});
					}else{
						$.openWindow({
							url: 'detail.html',
							waiting: {
								autoShow: false
							},
							extras: {
								rs_id: rs_id
							}
						});
					}
				});
			});
			
		}(mui, app));
	</script>
</body>
</html>